Add EC module with EcContext lifecycle and cookie domain computation#546
Closed
ChristianPavilonis wants to merge 1 commit intofeature/ssc-updatefrom
Closed
Add EC module with EcContext lifecycle and cookie domain computation#546ChristianPavilonis wants to merge 1 commit intofeature/ssc-updatefrom
ChristianPavilonis wants to merge 1 commit intofeature/ssc-updatefrom
Conversation
31fc460 to
fbf83bc
Compare
5b6ba39 to
c4981d4
Compare
fbf83bc to
2587b7a
Compare
…igration - Add ec/ module with EcContext lifecycle, generation, cookies, and consent - Compute cookie domain from publisher.domain, move EC cookie helpers - Fix auction consent gating, restore cookie_domain for non-EC cookies - Add integration proxy revocation, refactor EC parsing, clean up ec_hash - Remove fresh_id and ec_fresh per EC spec §12.1 - Migrate [edge_cookie] config to [ec] per spec §14
2587b7a to
e52ff39
Compare
Collaborator
Author
|
Superseded by #582 which consolidates the full EC epic into a single PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ec/module with two-phaseEcContextlifecycle (read_from_request+generate_if_needed), fixes consent gating to fail-closed for unknown jurisdictions and GPC in US states, and removes the"unknown"client IP fallback..{publisher.domain}per spec §5.2. Thecookie_domainconfig field is retained for non-EC cookies. EC cookie helpers moved fromcookies.rstoec/cookies.rs.fresh_id/ec_fresh/X-ts-ec-freshper spec §12.1 — this was a SyntheticID artifact not carried forward in the EC spec.Closes #533, Closes #535
Changes
ec/mod.rsEcContextstruct withread_from_request()andgenerate_if_needed(), sharedparse_ec_from_request()helper,get_ec_id()public APIec/generation.rsec_hash(),is_valid_ec_id(),extract_client_ip()ec/consent.rsec_consent_granted()wrapper delegating to consent moduleec/cookies.rscreate_ec_cookie,set_ec_cookie,expire_ec_cookie— usesec_cookie_domain()per spec §5.2edge_cookie.rsconsent/mod.rsJurisdiction::Unknownnow blocks EC (fail-closed); GPC independently blocks in US statescookies.rsec/cookies.rs)settings.rsec_cookie_domain()method (computed.{domain}for EC);cookie_domainfield retained for non-EC usepublisher.rsEcContextAPI with full consent-gated revocationintegrations/registry.rsEcContext; added consent-gated cookie setting AND revocation on withdrawalauction/endpoints.rsEcContext; EC value gated behindec_allowed()before forwarding to biddersauction/formats.rsfresh_idgeneration; removedX-ts-ec-freshresponse headerauction/types.rsfresh_idfromUserInfostructopenrtb.rsec_freshfield fromUserExtconstants.rsHEADER_X_TS_EC_FRESHconstant and internal header entryintegrations/prebid.rsec_freshpopulation in Prebid adapterproxy.rs,testlight.rsedge_cookie→ecconfiguration.md,first-party-proxy.md,error-reference.md,PUBLISHER_IDS_AUDIT.mdBreaking changes
generate_ec_id()takes a&strclient IP; no"unknown"fallbackJurisdiction::Unknownblocks EC creation — fail-closed when geo unavailableus_privacystring allows"2001:db8:85a3:0::"→"20010db885a30000"(existing IPv6 EC IDs invalidated)publisher.domain—cookie_domainconfig retained for non-EC cookies onlyfresh_id/ec_fresh/X-ts-ec-freshremoved — SyntheticID artifact not in EC spec (§12.1)user.idis empty when consent denied, preventing leaked identifiers to biddersVerification
cargo fmt --all -- --check— cleancargo clippy --workspace --all-targets --all-features -- -D warnings— zero warningscargo test --workspace— 715 tests passed, 0 failed